@extends('layout.default')

@section('layout.content')

  <div class="row">
    <div class="col-xs-12">
      <table id="book_list" class="table table-hover table-bordered table-striped">
        <thead>
        <tr>
          <th class="center hidden-480" style="width:60px;">帐号</th>
          <th class="align-middle" style="width:90px;">姓名</th>
          <th style="width:80px;" class="center">封面</th>
          <th style="width:130px;" class="center hidden-480">ISBN</th>
          <th class="align-left align-middle">书名</th>
          <th class="center hidden-480" style="width:100px;">借阅日期</th>
          <th style="width:70px;" class="center hidden-480">书架号</th>
          <th style="width:60px;" class="center hidden-480">状态</th>
          <th class="center" style="width:70px;">操作</th>
        </tr>
        </thead>

        <tbody>
        @foreach ($collections as $borrow)
          <tr>
            <td class="center hidden-480"><a
                  href="{{route('bank.user.edit',array('uid'=>$borrow->user->id) )}}">{{ $borrow->user->account }}</a>
            </td>
            <td class="align-middle">{!! $borrow->user->present()->face !!}<a
                  href="{{route('bank.user.show',array('uid'=>$borrow->user->id))}}" class="uid"
                  data-id="{{ $borrow->user->id }}">{{ $borrow->user->name }}</a></td>
            <td class="center"><a href="{{route('book.borrows',array('bid'=>$borrow->book->id) )}}"><img
                    src="/assets/images/books/{{ $borrow->book->dbid }}.jpg" width="60%"></a></td>
            <td class="center hidden-480"><a
                  href="{{ route('book.edit',array('bid'=>$borrow->book->id) ) }}">{{ $borrow->book->isbn }}</a></td>
            <td class="align-left align-middle">{{ $borrow->book->title }}</td>
            <td class="center hidden-480">{{date('Y-m-d',$borrow->date_begin)}}</td>
            <td class="center hidden-480">{!! $borrow->book->present()->bookStore !!}</td>
            <td class="center hidden-480">{!! $borrow->present()->BorrowStatus !!}</td>
            <td class="center">
              @if ($borrow->status == 0)
                <button class="btn btn-xs btn-success no-border return" type="button" data-value="{{$borrow->id}}">
                  还书
                </button>
              @endif
            </td>
          </tr>
        @endforeach

        </tbody>
      </table>

    </div><!-- /.col -->
  </div><!-- /.row -->



@stop


@section('javascript')
  <script src="/assets/js/user-func.js"></script>

@stop